package vip.xiaonuo.vein;


import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import vip.xiaonuo.vein.task.SyncRecordTask;
import vip.xiaonuo.vein.websocket.WebSocket;

import javax.annotation.Resource;

@RestController
public class TeskController {

    @Resource
    private SyncRecordTask syncRecordTask;

    @Resource
    private WebSocket webSocket;


    @GetMapping("/test/SyncRecordTask")
    public String test() {
        syncRecordTask.action("","");
        return "OK";
    }

    @PostMapping("/test/sendMessage")
    public String test( String text){
        webSocket.sendAllMessage(text);
        return "ok";
    }


}
